﻿Imports System.Data.OleDb
Public Class DangKyBanQuyenDAO
    Public Function GetDangKyBanQuyen(ByVal ma1 As String) As DangKyBanQuyenDTO
        Dim sql As String = String.Format("select * from DangKyBanQuyen where Ma1='{0}'", ma1)
        Dim Cn As OleDbConnection = DataProvider.OpenConnect
        Dim da As New OleDbDataAdapter(sql, Cn)
        Dim dt As New DataTable()
        da.Fill(dt)
        Cn.Close()
        Dim Ma As New DangKyBanQuyenDTO()
        If dt.Rows.Count > 0 Then
            Ma.Ma1 = dt.Rows(0)("Ma1").ToString()
            Ma.Ma2 = dt.Rows(0)("Ma2").ToString()
            Ma.Ma3 = dt.Rows(0)("Ma3").ToString()
            Ma.Ma4 = dt.Rows(0)("Ma4").ToString()
        End If
        Return Ma
    End Function
End Class
